<?php
class lapbank_model extends CI_Model
{
	// Call the module constructor
	function __construct(){
		parent::__construct();
	}
	
	function getMutasibank($tgl,$tgl2)
	{
		if ($tgl != "" or $tgl2 !="")
		{
			$query = $this->db->query("SELECT A.NoKwitansi,A.NoFaktur,A.TotalQuantity,A.TotalAmount_In,A.TotalAmount_Out,A.KodeBank,B.Bankname FROM mutasi_bank A,master_bank B WHERE A.KodeBank=B.KodeBank and A.Active='1' and A.CreatedOn between '".$tgl."' and '".$tgl2."'");
		}else{
			$query = $this->db->query("SELECT A.NoKwitansi,A.NoFaktur,A.TotalQuantity,A.TotalAmount_In,A.TotalAmount_Out,A.KodeBank,B.Bankname FROM mutasi_bank A,master_bank B WHERE A.KodeBank=B.KodeBank and A.Active='1'");
		}
		
		return $query->result();
	}
	
	function getMutasigiro($tgl,$tgl1)
	{
		if ($tgl != "" or $tgl1 !="")
		{
			$query = $this->db->query("SELECT NoKwitansi,NoFaktur,TotalQuantity,TotalAmount_In,TotalAmount_Out,Bankname,Nogiro as KodeBank from mutasi_giro where A.Active='1' and CreatedOn between '".$tgl."' and '".$tgl1."'");
		}else{
			$query = $this->db->query("SELECT NoKwitansi,NoFaktur,TotalQuantity,TotalAmount_In,TotalAmount_Out,Bankname,Nogiro as KodeBank from mutasi_giro where A.Active='1'");
		}
		
		return $query->result();
	}
}
?>